package com.kylin.androidlearn1.acticity.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.kylin.androidlearn1.acticity.bean.MyEntity;

import java.util.ArrayList;

/**
 * Created by kylinhuang on 10/4/16.
 */
public class GridViewAdapter  extends BaseAdapter {

    private final Context mContext;
    private final ArrayList<MyEntity> list;

    public GridViewAdapter(Context mContext, ArrayList<MyEntity> list) {
        this.mContext = mContext;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        TextView view = new TextView(mContext);
        view.setText("dddd");
        return view;
    }
}
